﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LedgerMonthly.aspx.cs" Inherits="Main_Reports_Accounts_LedgerMonthly"
    Culture="en-GB" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Monthly Ledger Details</title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">    
        function Validations() {
            if (document.getElementById("ddlLedger").value == '-1') {
                alert('Specify Ledger For Details');
                document.getElementById("ddlLedger").focus();
                return false;
            }
            else {
                return true;
            }
        }
        function OpenMonthlySummary(lid, lname, fromdate, todate) {
            window.open('LedgerMonthlySummary.aspx?LID=' + lid + '&LNAME=' + lname + '&FROMDATE=' + fromdate + '&TODATE=' + todate, '', 'height=600,width=900,scrollbars=1,resizable=1,titlebar=1');
            return true;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div style="width: 90%; margin-left: 5%; margin-right: 5%; margin-top: 7px;">       
    <asp:HiddenField ID="hidChartWidth" runat="server" Value="0" />
        <table width="97%" class="tablecontent">
            <tr>
                <td colspan="3" align="center" class="headtd">Monthly Ledger Details</td>
            </tr>
            <tr>
                <td style="width: 40%; padding-top: 10px; padding-left: 3px;" align="right" valign="top">
                    Choose Ledger : &nbsp;&nbsp;
                    <asp:DropDownList ID="ddlLedger" runat="server" CssClass="dropdown">
                    </asp:DropDownList>
                </td>
                <td style="width: 30%; padding-top: 10px; padding-left: 3px;"  valign="top">
                    <asp:Button ID="btnShow" runat="server" Text="Show" CssClass="button" OnClick="btnShow_Click" OnClientClick="return Validations();" />                                        
                </td>
                <td align="right" style="width: 30%; padding-top: 10px;"  valign="top">
                    <a href="LedgerMonthlyWithPeriod.aspx">Periodic Report</a>
                </td>
            </tr>
            </table>
           <asp:Panel ID="panelView" runat="server" Width="100%" style="margin-top:5px;">
            <table style="border:solid 1px #818181;" width="97%">
            <tr>
                <td  style="width: 100%;" class="headtd" align="center">
                    <asp:Label ID="lblHeading" runat="server" Font-Bold="true" ></asp:Label>
                </td>
            </tr>
            <tr>
                <td  style="width: 100%">
                    <asp:GridView ID="grdDisplay" CssClass="gridview" Width="100%" runat="server" OnRowDataBound="grdDisplay_RowDataBound"
                        AutoGenerateColumns="false" ShowFooter="true">
                        <Columns>
                            <asp:TemplateField HeaderText="Month" ItemStyle-Width="25%">
                                <ItemTemplate>
                                   <asp:HyperLink ID="hyperMonth" runat="server" NavigateUrl="#"><%#Eval("MonthName") %></asp:HyperLink> 
                                    <asp:HiddenField ID="hidFromDate" runat="server" Value='<%# Eval("FromDate")%>' />
                                    <asp:HiddenField ID="hidToDate" runat="server" Value='<%# Eval("ToDate")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>                            
                            <asp:TemplateField HeaderText="Debit" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="25%">
                                <ItemTemplate>
                                    <asp:Label ID="lblDebit" runat="server" Text='<%# Eval("Debit")%>'></asp:Label>
                                    <asp:HiddenField ID="hidDebit" runat="server" Value='<%# Eval("Debit")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Credit" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="25%">
                                <ItemTemplate>
                                    <asp:Label ID="lblCredit" runat="server" Text='<%# Eval("Credit")%>'></asp:Label>
                                    <asp:HiddenField ID="hidCredit" runat="server" Value='<%# Eval("Credit")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Balance" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="25%">
                                <ItemTemplate>
                                    <asp:Label ID="lblBalance" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
        </table> 
        <br />
        <%--<asp:Chart ID="monthlyChart" runat="server"  Visible="false" Width="750" BorderlineWidth="1" BorderlineColor="ActiveBorder"
            Height="200" ToolTip="Monthly Summary" ImageLocation="~/TempImageFiles">
            <Series>
                <asp:Series Name="Series1" XValueMember="MonthName" YValueMembers="BalanceForChart"
                    Color="#63a83b">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                    <AxisY Title="Amount">
                    </AxisY>
                    <AxisX IsLabelAutoFit="true">
                        <LabelStyle Angle="-90" Interval="1" />
                    </AxisX>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>--%>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
